package com.mtaite.study.mybatis.common;

/**
 * @author liqin
 * @Description TODO
 * @Date 2023/1/14 20:13
 */
public class RestResult<T> {
    private int code;
    private String messgae;

    private T data;

    public RestResult(T data) {
        this.code = 200;
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessgae() {
        return messgae;
    }

    public void setMessgae(String messgae) {
        this.messgae = messgae;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public  static <T> RestResult<T> success(T t){
        return new RestResult<T>(t);
    }
}
